import 'package:bigegg/global/user/xmm_account_manager.dart';
import 'package:bigegg/page/widget/xmm_article_list_view.dart';
import 'package:bigegg/widget/xmm_widget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class XmmMyArticleListPage extends StatefulWidget {
  const XmmMyArticleListPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return XmmMyArticleListPageState();
  }
}

class XmmMyArticleListPageState extends State<XmmMyArticleListPage>
    with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
  @override
  bool get wantKeepAlive => true;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Obx(
      () => Column(
        children: [
          Visibility(
            visible: XmmAccountManager.instance.myArticleInfoList.isNotEmpty,
            child: XmmArticleListView(
              articleList: XmmAccountManager.instance.myArticleInfoList,
            ),
          ),
          Visibility(
            visible: XmmAccountManager.instance.myArticleInfoList.isEmpty,
            child: getEmptyWidget(),
          )
        ],
      ),
    );
  }
}
